import request from '@/utils/request'

/**
 * 企业列表
 * @export
 * @param {*} params 
 * @returns 
 */
export function getEnterpriseListAPI(params){
  return request({
    url:'/park/enterprise',
    method:'get',
    params
  })
}

/**
 * 获取所属行业
 * @export
 * @returns 
 */
export function getIndustryListAPI(){
  return request({
    url:'/park/industry',
    method:'get'
  })
}

/**
 * 添加企业
 * @export
 * @param {*} data 
 * @returns 
 */
export function getAddEnterpriseAPI(data){
  return request({
    url:'/park/enterprise',
    method:'post',
    data
  })
}

/**
 * 查看企业
 * @export
 * @param {*} id
 * @returns 
 */
export function getEnterpriseDetailAPI(id){
  return request({
    url:`/park/enterprise/${id}`,
    method:'get',
  })
}

/**
 * 更新企业
 * @param {*} data
 * @returns
 */
export function updateExterpriseAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'PUT',
    data
  })
}

/**
 * 删除企业
 * @param {*} id
 * @returns
 */
export function delEnterpriseAPI(id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'delete'
  })
}

/**
 * 查询可租赁楼宇
 * @returns 
 */
export function getRentBuildingAPI(){
  return request({
    url:'/park/rent/building',
    method:'get',
  })
}

/**
 * 添加/续租企业的租赁合同
 * @param {*} data 
 * @returns 
 */
export  function addRentAPI(data){
  return request({
    url:'/park/enterprise/rent',
    method:'post',
    data
  })
}

/**
 * 企业租赁信息列表-展开查看
 * @param {*} id 
 * @returns 
 */
export function getEnterpriseRentListAPI(id){
  return request({
    url:`/park/enterprise/rent/${id}`
  })
}

/**
 * 退租
 * @param {*} id 
 * @returns 
 */
export function rentingOutAPI(id){
  return request({
    url:`/park/enterprise/rent/${id}`,
    method:'put'
  })
}

/**
 *删除租赁合同
 *
 * @export
 * @param {*} rentId 合同id
 * @return {*}
 */
 export function delRentAPI(rentId) {
  return request({
    url: `/park/enterprise/rent/${rentId}`,
    method: 'delete'
  })
}